<template>
  <view style="height: 100vh;" class="u-f-ac">
    <button @click="copy">点击复制内存卡视频文件</button>
  </view>
</template>

<script>
  export default {
    data() {
      return {

      }
    },
    methods: {
      copy() {
        uni.showLoading()
        this.$utils.resolveLocalFileSystemURL('/storage/emulated/0/sdcard/video').then(async entry => {
          // console.log(entry)
          let parentEntry = await this.$utils.resolveLocalFileSystemURL('/storage/emulated/0')
         
          entry.copyTo(parentEntry, 'videoTopic', (copyPath) => {
            copyPath.getFile('1.txt', {
              create: true
            })
            uni.hideLoading()
            this.$redirectTo('/pages/index/index')
            // console.log(copyPath)
          }, (err) => {
            console.log(err)
            this.$showToast('拷贝失败')
          })

        }).catch(err => {
           uni.hideLoading()
          this.$showToast('未检测到内存卡里视频文件')
        })

      }
    }
  }
</script>

<style>

</style>
